print("我是一个求平均值的小程序")
user_input = input("输入q结束程序")
total = 0;
count = 0;
while user_input != "q":
    total += float(user_input)
    count = count+1
    user_input = input("输入q结束程序")
if count == 0:
    result = 0
else:
    result = total/count
print("平均值为: "+str(result))
